<template>
	<view class="propertyDetails">
		<view class="tubiao">
			<uni-icons type="checkmarkempty" size="45" color="#026cfd"></uni-icons>
		</view>

		<text v-if="data.state=='审核通过'">认证成功</text>
		<text v-if="data.state=='审核中'">房屋审核中，请耐心等待</text>
		<text v-if="data.state=='审核失败'">房屋审核失败，请核对信息</text>
		<uni-steps class="steps" :options="list1" :active="active" active-color="#026cfd" />
		<view class="defails-item">
			<view class="item-title">
				<view></view>
				<text>房屋信息</text>
			</view>
			<view class="item-content">
				<view class="row"><text>小区</text><text>{{data.community}}</text></view>
				<view class="row"><text>房间号</text><text>{{data.room}}</text></view>
				<view class="row"><text>业主</text><text>{{data.name}}</text></view>
				<view class="row"><text>房屋状态</text><text>{{data.houseState}}</text></view>
			</view>
		</view>
		<view class="defails-item">
			<view class="item-title">
				<view></view>
				<text>住户信息</text>
			</view>
			<view class="item-content host">
				<view class="row"><text>住户姓名</text><text>{{data.name}}</text></view>
				<view class="row"><text>住户性别</text><text>{{data.sex}}</text></view>
				<view class="row"><text>证件类型</text><text>{{data.certificateType}}</text></view>
				<view class="row"><text>身份证号</text><text>{{data.identificationNumber}}</text></view>
				<view class="row"><text>与业主关系</text><text>{{data.relationships}}</text></view>
				<view class="row"><text>手机号码</text><text>{{data.phoneNumber}}</text></view>
				<view class="photo">
					<text>本人身份证照片</text>
					<view id="t1">
						<img :src="data.certificateFront" v-if="data.certificateFront" alt="">
						<text v-else>暂无照片</text>
					</view>
					<view class="t2">
						<img :src="data.certificateBack" v-if="data.certificateFront" alt="">
						<text v-else>暂无照片</text>
					</view>


				</view>
			</view>

		</view>
		<view class="operate">
			<navigator url="../../myHouse/addHouse/addHouse" hover-class="navigator-hover" v-if="data.state!='审核通过'">
				<view class="edit">修改</view>
			</navigator>
			<view class="del" @click="open">删除</view>
		</view>
		<uni-popup ref="popup" type="bottom">
			<view class="tishi">
				<view class="tishi-top">确定删除此房屋信息吗？</view>
				<view class="tishi-sel">
					<text @click="closeNo">否</text>
					<navigator url="../myHouse" hover-class="navigator-hover">
						<text @click="closeYes">是</text>
					</navigator>
				</view>
			</view>
		</uni-popup>


	</view>



</template>

<script>
	import {
		http
	} from "../../../utils/http.js"
	export default {
		data() {
			return {
				active: 2,
				list1: [{
					title: '房屋信息',
				}, {
					title: '住户信息'
				}, {
					title: '物业审核'
				}, {
					title: '认证成功'
				}],
				imageStyles: {
					width: 318,
					height: 120,
					// backgroundColor: "#f3f7ff",
					border: {
						color: "#ccc",
						width: 2,
						style: 'solid',
						radius: '2px'
					},
				},
				data: [],
				idDel:null
		

			};
		},
		methods: {
			open() {
				this.$refs.popup.open('top')
			},
			closeNo() {
				this.$refs.popup.close()
			},
			closeYes() {
				this.$refs.popup.close()
				console.log(this.idDel,"ssss")
				let idArr=[]
				idArr.push(this.idDel)
				console.log(idArr,"uuuu")
				http({
					url:"/householdManagement/delete",
					method:"DELETE",
					data:{
						ids:idArr
					}
				}).then((res)=>{
					console.log(res,"mmmmmmm")
				})
			},
		},
		onLoad(option) {
			this.data = JSON.parse(option.dotMsg)
			if (this.data.state == "审核通过") {
				this.active = 3
			}
			if (this.data.state == "审核中" || this.data.state == "审核失败"||this.data.state == "") {
				this.active = 2
			}
			this.idDel=this.data.id
		}
	}
</script>

<style lang="less" scoped>
	.propertyDetails {
		padding: 0 30rpx;

		.tubiao {
			margin: 60rpx auto;
			margin-bottom: 30rpx;
			width: 90rpx;
			height: 89rpx;
			text-align: center;
			line-height: 89rpx;
			border-radius: 50rpx;
			border: 8rpx solid #026cfd;

		}

		text {
			display: block;
			text-align: center;
			font-size: 34rpx;

		}

		.defails-item {
			padding-top: 40rpx;
			padding-left: 38rpx;
			padding-right: 38rpx;
			display: flex;
			flex-direction: column;
			align-items: flex-start;
			border-radius: 10rpx;
			margin-bottom: 42rpx;
			box-shadow: 0px 0px 15rpx rgba(0, 0, 0, .2);

			.item-title {
				display: flex;
				margin-bottom: 40rpx;
				align-items: center;
				justify-content: flex-start;

				view {
					width: 16rpx;
					height: 34rpx;
					background-color: #056cff;
					border-radius: 8rpx;
				}

				text {
					margin-left: 20rpx;
					font-size: 32rpx;

				}
			}

			.item-content {
				width: 100%;
				display: flex;
				flex-direction: column;
				align-items: flex-start;

				.row {
					display: flex;
					width: 100%;
					justify-content: flex-start;
					padding: 30rpx 0;
					border-bottom: 1px solid #eee;

					text:nth-child(1) {
						color: #a8a8a8;
						text-align: left;
						width: 170rpx;
					}
				}

				.row:last-child {
					border: 0px;
				}

			}

			.host {
				.row {
					text:nth-child(1) {
						width: 200rpx;
					}
				}

				.photo {
					padding: 30rpx 0;

					text:nth-child(1) {
						color: #a8a8a8;
						text-align: left;
						margin-bottom: 30rpx;
					}

					#t1 {
						margin-bottom: 40rpx;

						img {
							width: 610rpx;
							height: 320rpx;
						}
					}

					.t2 {
						margin-bottom: 170rpx;

						img {
							width: 610rpx;
							height: 320rpx;
						}
					}
				}
			}
		}

		.operate {
			width: 100%;
			height: 140rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			position: fixed;
			left: 0rpx;
			bottom: 0rpx;
			background-color: #ffffff;
			border-top: 1px solid #ccc;

			view {
				width: 334rpx;
				height: 82rpx;
				text-align: center;
				line-height: 82rpx;
				border-radius: 8rpx;
				font-size: 32rpx;
			}

			.edit {
				background-color: #006fff;
				color: white;
				margin-right: 16rpx;
			}

			.del {
				background-color: white;
				color: #c9768a;
				border: 1px solid #c9768a;
			}
		}

		.tishi {
			margin: 300rpx auto;
			width: 600rpx;
			background-color: white;
			border-radius: 8rpx;

			.tishi-top {
				height: 150rpx;
				padding-left: 50rpx;
				line-height: 150rpx;
			}

			.tishi-sel {
				border-top: 1px solid #eee;
				display: flex;
				align-items: c1;

				text {
					flex: 1;
					height: 80rpx;

					text-align: center;
					line-height: 80rpx;
					font-size: 32rpx;

				}

				navigator {
					flex: 1;
				}

				text:nth-child(1) {
					border-right: 1px solid #eee;
				}
			}
		}
	}
</style>
<style lang="less">
	.propertyDetails {
		.uni-steps {
			margin: 60rpx auto;

			.uni-icons {
				font-size: 40rpx !important;
			}
		}

	}
</style>
